import 'package:flutter/material.dart';
import 'package:flutter_ability/custom_ui.dart';

class AvatarPage extends StatefulWidget {
  const AvatarPage({Key? key}) : super(key: key);

  @override
  State<AvatarPage> createState() => _AvatarPageState();
}

class _AvatarPageState extends State<AvatarPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: YJAppBar(
        isScaffold: true,
        leadingType: YJAppBarType.back,
        title: TextView.text("Image 头像"),
        backgroundColor: YJColors.WHITE,
      ),
      backgroundColor: YJColors.WHITE,
      body: buildContainer2(),
    );
  }

  Widget buildContainer2() {
    return Container(
      margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 20),
      child: SingleChildScrollView(
          child:
              Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
        Row(
          children: [
            YJAvatar(
              backgroundImage: const AssetImage('assets/icon_no_follow.png'),
            ),
            const SizedBox(width: 10),
            YJAvatar(
              backgroundImage: const AssetImage('assets/icon_no_gift_pack.png'),
            ),
            const SizedBox(width: 10),
            YJAvatar(
              backgroundImage: const AssetImage('assets/icon_no_gift_pack.png'),
              shape: YJAvatarShape.square,
            ),
            const SizedBox(width: 10),
            YJAvatar(
              backgroundImage: const AssetImage('assets/icon_no_gift_pack.png'),
              shape: YJAvatarShape.square,
            ),
            const SizedBox(width: 10),
            YJAvatar(
              backgroundImage: const AssetImage('assets/icon_no_gift_pack.png'),
              shape: YJAvatarShape.standard,
            ),
            const SizedBox(width: 10),
            YJAvatar(
              backgroundImage: const AssetImage('assets/icon_no_gift_pack.png'),
              shape: YJAvatarShape.standard,
            ),
          ],
        ),
        const SizedBox(height: 20),
        Row(
          children: [
            YJIconBadge(
              counterChild: const YJBadge(
                shape: YJBadgeShape.circle,
                text: "",
                size: 20,
                border: BorderSide(
                  color: Colors.white,
                  width: 1,
                ),
              ),
              position: YJBadgePosition(top: YJSize.dp(0), end: YJSize.dp(0)),
              child: YJAvatar(
                backgroundImage: const AssetImage('assets/icon_no_follow.png'),
              ),
            ),
            const SizedBox(width: 10),
            YJIconBadge(
              counterChild: const YJBadge(
                shape: YJBadgeShape.circle,
                text: "",
                size: 20,
                border: BorderSide(
                  color: Colors.white,
                  width: 1,
                ),
              ),
              position: YJBadgePosition(top: YJSize.dp(0), end: YJSize.dp(0)),
              child: YJAvatar(
                backgroundImage:
                    const AssetImage('assets/icon_no_gift_pack.png'),
              ),
            ),
            const SizedBox(width: 10),
            YJIconBadge(
              counterChild: const YJBadge(
                shape: YJBadgeShape.circle,
                text: "",
                size: 20,
                border: BorderSide(
                  color: Colors.white,
                  width: 1,
                ),
              ),
              position: YJBadgePosition(top: YJSize.dp(0), end: YJSize.dp(0)),
              child: YJAvatar(
                shape: YJAvatarShape.square,
                backgroundImage:
                    const AssetImage('assets/icon_no_gift_pack.png'),
              ),
            ),
            const SizedBox(width: 10),
            YJIconBadge(
              counterChild: const YJBadge(
                shape: YJBadgeShape.circle,
                text: "",
                size: 20,
                border: BorderSide(
                  color: Colors.white,
                  width: 1,
                ),
              ),
              position: YJBadgePosition(top: YJSize.dp(0), end: YJSize.dp(0)),
              child: YJAvatar(
                shape: YJAvatarShape.standard,
                backgroundImage:
                    const AssetImage('assets/icon_no_gift_pack.png'),
              ),
            ),
          ],
        ),
      ])),
    );
  }
}
